//
//  TLDetailViewContentViewController.h
//  Growth
//
//  Created by MEET on 12-1-13.
//  Copyright 2012 MEETStudio. All rights reserved.
//  日志详细页面


#import <UIKit/UIKit.h>
#import "WebRequest.h"
#import "WebConnetionArray.h"
#import "WebConnection.h"
#import "CJSONSerializer.h"
#import "CJSONDeserializer.h"
#import <QuartzCore/QuartzCore.h>
#import "PushRightViewController.h"


#import "CommentViewController.h"

#import "HPGrowingTextView.h"

#import "GrowthAppDelegate.h"

#import "ASIHTTPConnection.h"

#import "RecordViewController.h"

@protocol TLDetailViewContentControllerDelegate;

@interface TLDetailViewContentViewController : PushRightViewController<
commentViewControllerDelegate,
UITextFieldDelegate,
HPGrowingTextViewDelegate,ASIHTTPConnectionDelegate> {

	UIButton *userIcon;
	UILabel *userName;
    UILabel *localLabel;
    
    int pageNo;
	
	//Data
	NSDictionary *diaryDict;    
    UIScrollView *scrollView;
	
	UIView *commentView;
    CommentViewController *commentViewController;   
        
    NSString *commentText;
    UILabel *commentCountLabel;
    
    int superId;
    int commentTo;
    
       
    //diary favor
    UILabel *favorCountLabel;
      
    UIView *yuanJiaoView;
      
    int userId;
    int diaryId;
    
    //显示内容类型
    NSString *type;
    
    //图片url
    NSArray *pictureList;
    
    //GRowing TextView 
    UIView *containerView;
    HPGrowingTextView *textView;
        
    IBOutlet UIButton *backGoundButton;
        
      	
}

@property (assign) id<TLDetailViewContentControllerDelegate> delegate; 

@property(nonatomic) int userId;

@property (nonatomic,retain)  NSString *type;


@property(nonatomic,retain) IBOutlet    UIButton *userIcon;
@property(nonatomic,retain) IBOutlet 	UILabel *userName;
@property(nonatomic,retain) IBOutlet    UILabel *localLabel;

//Data
@property(nonatomic,retain) NSDictionary *diaryDict;

@property(nonatomic,retain)IBOutlet UIScrollView *scrollView;
@property(nonatomic,retain)IBOutlet UIView *commentView;

//评论
@property (nonatomic,retain)  NSString *commentText;
@property(nonatomic,retain)UILabel *commentCountLabel;
@property(nonatomic) int superId;
@property(nonatomic) int commentTo;
@property (nonatomic, retain) CommentViewController *commentViewController;

//favor
@property (nonatomic,retain)  UILabel *favorCountLabel;


- (void)initContentView;

- (void)initLocalContentView;

-(NSString *)changeStringFommat:(NSString *)str;

-(IBAction)commitComment:(NSString *)commentContent;


-(void)postComment;
-(void)refreshComment;


- (void)loadDetailDiaryWith:(NSString *)did;

- (id)initWithPost:(NSDictionary *)dict;

- (id)initWithDid:(int)did conttentType:(NSString *)conttentType;

-(void)diaryLike:(id)sender;

//comment view delegate

-(void)setCommentPrama:(int)_superId commentTo:(int)_commentTo;

- (IBAction)toUserView:(id)sender;

- (void)toBabyTimelineView:(id)sender;


//滑动相册
- (void)toPhotoBook:(NSArray *)images;


//Growing Text View 
- (void)resignTextView;
- (void)initGrowingTextView;
- (IBAction)backGroundTap;

@end



//Delegate
@protocol TLDetailViewContentControllerDelegate <NSObject>
@optional 

- (IBAction)toUserView:(id)sender;
- (void)toBabyTimelineView:(id)sender;
- (void)toPhotoBook:(NSArray *)images;

//textView
- (void)addGrowingTextView:(UIView *)view;

//time tile
- (void)setTimeTitle:(NSString *)str;

@end



